<template>
  <div class="container">
    <div class="tip">热门专业</div>
    <div class="popular">
      <div
        class="box1"
        v-for="item in imgs"
        :key="item._id"
        style="position: relative"
      >
        <span
          style="
            display: inline-block;
            width: 150px;
            height: 150px;
            margin: 10px 0 10px 10px;
          "
        >
          <a href="javascript:;">
                <img :src="item.img" alt="">

            </a></span
        >
        <span
          style="position: absolute; top: 50px; left: 170px; font-size: 15px"
          >{{item.name}}</span
        >
        <div
          style="
            width: 100%;
            height: 130px;
            position: absolute;
            top: 170px;
            left: 0;
            overflow:hidden
          "
        >{{item.article}}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      imgs: []
    }
  },
  created() {
    this.$http2({
      url: '/home/schedule_img',
      method: 'get'
    }).then(res => {
      this.imgs = res.data
      // console.log(this.imgs);
    })
  }
}
</script>

<style lang="less" scoped>
.container {
  box-sizing: border-box;
  border: 1px solid #ccc;
  margin-top: 50px;
}
.tip {
  width: 200px;
  font-family: xingkai;
  font-size: 30px;
  background-image: linear-gradient(to right, orangered, orange, gold);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.popular {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  .box1 {
    width: 290px;
    height: 300px;
    border: 1px solid #ccc;
    margin-top: 5px;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
</style>